<!--<div class="layui-form-item">-->
<!--    <label class="layui-form-label required">UID</label>-->
<!--    <div class="layui-input-block">-->
<!--        <input type="text" class="layui-input" readonly value="{$row.uid|default=''}">-->
<!--        <tip></tip>-->
<!--    </div>-->
<!--</div>-->

<div class="layui-form-item">
    <label class="layui-form-label">买家</label>
    <div class="layui-input-block">
        <!--        <input type="text" class="layui-input" readonly value="{$row.member.mobile|default=''}">-->
        <a href="" class="layui-form-label-col">{$row.member.mobile|default=''}</a>
        <tip></tip>
    </div>
</div>


<!--<div class="layui-form-item">-->
<!--    <label class="layui-form-label required">{$row.member.mobile}</label>-->
<!--    <div class="layui-input-block">-->
<!--        <img src="{$row.member.head_img}" alt="">-->
<!--    </div>-->
<!--</div>-->


<div class="layui-form-item">
    <label class="layui-form-label">订单号</label>
    <div class="layui-input-block">
        <!--        <input type="text" class="layui-input" readonly value="{$row.order_sn|default=''}">-->
        <div class="layui-form-label-col">
            {$row.order_sn|default=''}
        </div>
        <tip></tip>
    </div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">订单类型</label>
    <div class="layui-input-block">
        <!--        <input type="text" class="layui-input" readonly value="{$row.order_sn|default=''}">-->
        <div class="layui-form-label-col">
            {if $row.type===0} 普通订单 {else /} 拼团订单{/if}
        </div>
        <tip></tip>
    </div>
</div>


<div class="layui-form-item">
    <label class="layui-form-label">订单状态</label>
    <div class="layui-input-block">
        <div class="layui-form-label-col">
            <p id="status" style="display: inline">{$row.status_zh}</p>
            <!--            <button id="receive_money" type="button" onclick="receive_money()" class="layui-btn layui-btn-primary layui-btn-sm">确认收款</button>-->
            {if $row.status === 0}<button id="receive_money" type="button" class="layui-btn layui-btn-primary layui-btn-sm">确认收款</button>{/if}
            {if $row.status === 0}<button id="cancel_order" type="button" class="layui-btn layui-btn-primary layui-btn-sm">取消订单</button>{/if}
            {if $row.status === 1}<button id="send_goods" type="button" class="layui-btn layui-btn-primary layui-btn-sm">确认发货</button>{/if}
            {if $row.status === 2}<button id="receive_goods" type="button" class="layui-btn layui-btn-primary layui-btn-sm">确认收货</button>{/if}
            {if $row.type === 0 && ($row.status === 1 || $row.status === 2 || $row.status === 3) && $row.type===0}<button id="apply_cancel" type="button" class="layui-btn layui-btn-primary layui-btn-sm">申请退款</button>{/if}
<!--            {if $row.status === 4}<button id="receive_money1" type="button" class="layui-btn layui-btn-primary layui-btn-sm">确认收款</button>{/if}-->
            {if $row.status === 4}<a href="/{$Admin}/finace.offlinepayment/edit?id={$order_xianxia_id}"><button id="receive_money1" type="button" class="layui-btn layui-btn-primary layui-btn-sm">点击去审核</button></a>{/if}
        </div>
        <!--        <select name="status">
                    {foreach $status_array as $k=>$v}
                    <option value="{$k}" {if $row.status==$k}selected{/if}>{$v|raw}</option>
                    {/foreach}
                </select>-->
    </div>
</div>




<div class="layui-form-item">
<!--        <label class="layui-form-label required">订单金额</label>-->
<!--        <div class="layui-input-block">-->
            <div class="layui-inline">
                <label class="layui-form-label">商品金额:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.goods_price}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">运费:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.dispatch_price}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">优惠金额:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.discount_price}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">商品总金额:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.order_goods_price}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">抵扣总金额:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.deduction_price}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">订单支付记录:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.order_pay_id}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">成本总价:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.cost_amount}
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">是否虚拟订单:</label>
                <div class="layui-input-inline layui-form-label-col">
                    {$row.is_virtual}
                </div>
            </div>


<!--        </div>-->
<!--    <label class="layui-form-label required">订单金额</label>-->
<!--    <div class="layui-input-block">-->
<!--        <div class="layui-form-label-col">-->
<!--             <br>-->
<!--            运费: {$row.dispatch_price}<br>-->
<!--            优惠金额: {$row.discount_price}<br>-->
<!--            商品订单总金额: {$row.order_goods_price}<br>-->
<!--            抵扣总金额: {$row.deduction_price}<br>-->
<!--            订单支付记录: {$row.order_pay_id}<br>-->
<!--            成本总价: {$row.cost_amount}<br>-->
<!--            是否虚拟订单: {$row.is_virtual}<br>-->
<!--        </div>-->
<!--    </div>-->
</div>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">收货电话:</label>
        <div class="layui-input-inline layui-form-label-col">
            {$row.address.mobile}
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">收货人:</label>
        <div class="layui-input-inline layui-form-label-col">
            {$row.address.realname}
        </div>
    </div>
</div>



<div class="layui-form-item">
    <label class="layui-form-label required"> 订单改价金额
    </label>
    {if $row.status === 0}
    <div class="layui-input-block">
        <input name="change_price" type="number" class="layui-input"
               value="{$row.change_price|default=''}">
        <tip></tip>
    </div>
    {else /}
    <div class="layui-form-label-col">
        {$row.change_price|default='未改价'}
    </div>
    {/if}
</div>
<div class="layui-form-item">
    <label class="layui-form-label"> 运费改价金额
    </label>
    {if $row.status === 0}
    <div class="layui-input-block">
        <input name="change_dispatch_price" type="number" class="layui-input"
               value="{$row.change_dispatch_price|default=''}">
        <tip></tip>
    </div>
    {else /}
    <div class="layui-form-label-col">
        {$row.change_dispatch_price|default='未改价'}
    </div>
    {/if}
</div>



<div class="layui-form-item">
    <label class="layui-form-label">评论状态</label>
    <div class="layui-input-block">
        <div class="layui-form-label-col">
            {$row.comment_status}
        </div>
    </div>
</div>


<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">客户备注</label>
    <div class="layui-input-block">
        <textarea name="member_remark" disabled class="layui-textarea"
                  placeholder="暂无">{$row.member_remark|default=''}</textarea>
    </div>
</div>

<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">商家备注</label>
    <div class="layui-input-block">
        <textarea name="merchant_remark" class="layui-textarea"
                  placeholder="请输入备注信息">{$row.merchant_remark|default=''}</textarea>
    </div>
</div>

<!--<div class="layui-form-item layui-form-text">-->
<!--    <label class="layui-form-label">商品信息</label>-->
<!--    <div class="layui-input-block">-->
<!--        <table id="goods"></table>-->
<!--    </div>-->
<!--</div>-->

<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">商品信息</label>
    <div class="layui-input-block">
        <!--        <button class="layui-btn layui-btn-normal layui-btn-sm" data-open="system.menu/add" data-title="添加" data-full="true"><i class="fa fa-plus"></i> 添加</button>-->
        <!--        <button class="layui-btn layui-btn-normal layui-btn-sm"-->
        <!--                data-open="/{$Admin}/order.order_goods/get_goods/?order_id={$row.id}" data-title="查看订单商品" data-full="false" data-width="600" data-height="300">-->
        <!--            查看订单商品-->
        <!--        </button>-->
        <table class="layui-table">
            <colgroup>
                <col width="20">
                <col width="120">
                <col width="120">
                <col width="120">
                <col width="120">
                <col width="120">
                <col width="120">
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>ID</th>
                <th>商品标题</th>
                <th>订单商品数</th>
                <th>真实价格</th>
                <th>商品规格</th>
                <th>商品快照价格</th>
                <!--                <th>改价金额</th>-->
                <!--                <th>确定改价</th>-->
            </tr>
            </thead>
            <tbody>
            {foreach $row.goods as $goods}
            <tr>
                <td>{$goods.id}</td>
                <td><a href="{if $row.type===0}/{$Admin}/goods.home/edit?id={$goods.goods_id}{else /}/{$Admin}/plugins.hasog_pintuan-index-index-edit?id={$goods.goods_id}{/if}">{$goods.title}</a></td>
                <td>{$goods.total}</td>
                <td>{$goods.price}</td>
<!--                <td>{$goods.goods_sn}</td>-->
                <td>{foreach $goods.goods_option as $v}
                    {$v.title}:{$v.value}<br>
                    {/foreach}
                </td>
                <td>{$goods.goods_price}</td>
                <!--                <td id="change-{$goods.id}" class="change-goods">{$goods.change_price}</td>-->
                <!--                <td is_input="false" onclick="change_goods(this,'{$goods.id}')">{$goods.change_price}</td>-->
                <!--                <td>-->
                <!--                    <input class="layui-input change-goods" type="text" name="change_price" value="{$goods.change_price}" >-->
                <!--                </td>-->
                <!--                <td>
                &lt;!&ndash;                    <button onclick="send_change(this, '{$goods.id}')" class="send-button layui-btn layui-btn-normal layui-btn-sm">&ndash;&gt;
                                    <button class="send-button layui-btn layui-btn-normal layui-btn-sm">
                                        确定修改
                                    </button>
                                </td>-->
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
</div>

<script type="text/javascript">
    require(["jquery"], function ($) {
        $('change-goods').each(function (event) {
            // $(this).click(function (event){
            //     event.stopPropagation()
            //     console.log($(this).text())
            // })
            // $(this).changeEvent('change',)
        })

        /*        function receive_money() {
                    $.ajax({
                        url: 'receive_money',
                        dataType: 'json',
                        data: {'order_id': },
                        success: function(res) {
                            // 假如返回的 res.data 是需要导出的列表数据
                            console.log(res.data);// [{name: 'wang', age: 18}, {name: 'layui', age: 3}]
                        }
                    });
                }*/


    })


    require(["jquery"], function ($) {
        // $(document).ready(
        /*        $('.change-goods').each(function (event) {
                    // alert($(this).text())
                    // $(this).on('click', function () {
                    $(this).click(function (event) {
                        alert(1)
                        old_change_price = $(this).attr('class')
                        console.log(old_change_price)
                        str = '<input class="layui-input" type="text" name="change_price" value="' + old_change_price + '" >'
                        $(this).html(str);
                    })
                })*/
        // $('.change-goods').click(function (event) {
        //     alert(1)
        //     old_change_price = $(this).attr('class')
        //     console.log(old_change_price)
        //     str = '<input class="layui-input" type="text" name="change_price" value="' + old_change_price + '" >'
        //     $(this).html(str);
        // })
        // $('.change-goods').on('click', function (event) {
        //     alert(2)
        //     // alert(1)
        //     // old_change_price = $(this).attr('class')
        //     // console.log(old_change_price)
        //     // str = '<input class="layui-input" type="text" name="change_price" value="' + old_change_price + '" >'
        //     // $(this).html(str);
        // })
        // )
    })

    // function change_goods(event, goods_id) {
    //     console.log(event.innerText)
    //     is_input = event.getAttribute('is_input')
    //     console.log(goods_id)
    //     old_change_price = event.innerText
    //     event.setAttribute('onclick', '')
    //     str = '<input class="layui-input" type="text" name="change_price" value="' + old_change_price + '" >'
    //     event.innerHTML = str
    // }


</script>

<!--<script src="/layui/layui.js"></script>-->
